<template>
  <div class="van-datetime-dict">
    <h1 @click="setValue">哈哈</h1>
    <van-form :readonly="false"  input-align="right"  :disabled="false">
    <van-datetime-dict :disabled="false" label="日期(dateTime)" title="日期(dateTime)" label-width="140px" input-align="right" placeholder="请选择日期" v-model="value1"></van-datetime-dict>
    <van-datetime-dict  label="dateTime赋值" title="dateTime赋值" label-width="140px" input-align="right" placeholder="请选择日期"  v-model="value11"></van-datetime-dict>
    <van-datetime-dict  label="日期(date)" type="date" title="日期(date)" label-width="140px" input-align="right" placeholder="请选择日期"  v-model="value2"></van-datetime-dict>
    <van-datetime-dict  label="日期(date赋值)" type="date" title="日期(date赋值)" label-width="140px" input-align="right" placeholder="请选择日期"  v-model="value22"></van-datetime-dict>
    <van-datetime-dict  label="日期(time)" type="time" title="日期(time)" label-width="140px" input-align="right" placeholder="请选择日期"  v-model="value3"></van-datetime-dict>
    <van-datetime-dict  label="日期(time赋值)" type="time" title="日期(time赋值)" label-width="140px" input-align="right" placeholder="请选择日期"  v-model="value33"></van-datetime-dict>
    <van-datetime-dict  label="日期(year-month)" type="year-month" title="日期(year-month)" label-width="140px" input-align="right" placeholder="请选择日期"  v-model="value4"></van-datetime-dict>
    <van-datetime-dict  label="日期(year-month赋值)" type="year-month" title="日期(year-month赋值)" label-width="140px" input-align="right" placeholder="请选择日期"  v-model="value44"></van-datetime-dict>
    <van-datetime-dict  label="日期(month-day)" type="month-day" title="日期(month-day)" label-width="140px" input-align="right" placeholder="请选择日期"  v-model="value5"></van-datetime-dict>
    <van-datetime-dict  label="日期(month-day赋值)" type="month-day" title="日期(month-day赋值)" label-width="140px" input-align="right" placeholder="请选择日期"  v-model="value55"></van-datetime-dict>
    <van-datetime-dict  label="日期(datehour)" type="datehour" title="日期(datehour)" label-width="140px" input-align="right" placeholder="请选择日期"  v-model="value6"></van-datetime-dict>
    <van-datetime-dict  label="日期(datehour赋值)" type="datehour" title="日期(datehour赋值)" label-width="140px" input-align="right" placeholder="请选择日期"  v-model="value66"></van-datetime-dict>
    <van-datetime-dict showForever  label="日期(永久)" title="日期(datehour)" label-width="140px" input-align="right" placeholder="请选择日期"  v-model="value7"></van-datetime-dict>
    <van-datetime-dict showForever label="日期(永久赋值)" title="日期(datehour赋值)" label-width="140px" input-align="right" placeholder="请选择日期"  v-model="value77"></van-datetime-dict>
    <van-datetime-dict showForever label="日期(永远赋值)" showValueLabel="永远" title="日期(datehour赋值)" label-width="140px" input-align="right" placeholder="请选择日期"  v-model="value777"></van-datetime-dict>
    <van-datetime-dict showForever label="日期(永久赋值)" forverValue="2099-12-31" title="日期(datehour赋值)" label-width="140px" input-align="right" placeholder="请选择日期"  v-model="value7777"></van-datetime-dict>
    <van-datetime-dict showForever label="自定义格式化" dateFormat="yyyy/MM/dd hh:mm" title="自定义格式化" label-width="140px" input-align="right" placeholder="请选择日期"  v-model="value8"></van-datetime-dict>
    <van-datetime-dict showForever label="默认值" defaultVal="2021-01-01 12:00" title="默认值" label-width="140px" input-align="right" placeholder="请选择日期"  v-model="value9"></van-datetime-dict>
    <van-datetime-dict class="search-item" @dictChange="handleChange" type="date" title="选择年月日" v-model="formSearch.taskDate"></van-datetime-dict>
    </van-form>
 </div>
</template>

<script>
export default {
  data() {
    return {
      value1: "",
      value11: "2016-06-07 05:00",
      value2: "",
      value22: "2022-03-21",
      value3: "",
      value33: "07:05",
      value4: "",
      value44: "2012-07",
      value5: "",
      value55: "05-12",
      value6: "",
      value66: "2019-07-01 07",
      value7: "",
      value77: "forever",
      value777: "forever",
      value7777: "2099-12-31",
      value8: "",
      value9: "faf",
      formSearch: {
        taskDate: "2023-06-30"
      }
    }
  },
  created() {
    setTimeout(() => {
      this.value22 = "2023-06-06"
      this.value7 = "forever"
    }, 2000)
  },
  methods: {
    setValue() {
      this.formSearch.taskDate = "2023-06-30"
    },
    handleChange(val) {
      console.log(this.formSearch.taskDate)
    }
  }
}
</script>

<style>

</style>